{% extends "admin/change_form.html" %}
{% load i18n admin_urls static admin_modify %}

{% block object-tools-items %}
    <li>
        <a href="{% url 'admin:grading_repository_changelist' %}" class="viewlink">
            {% translate "View on site" %}
        </a>
    </li>
    {% if has_absolute_url %}
        <li>
            <a href="{{ absolute_url }}" class="viewlink">
                {% translate "View on site" %}
            </a>
        </li>
    {% endif %}
    {% if has_delete_permission %}
        <li>
            <a href="{% url 'admin:grading_repository_delete' original.pk|admin_urlquote %}" class="deletelink">
                {% translate "Delete" %}
            </a>
        </li>
    {% endif %}
{% endblock %}

{% block content %}
    <div id="content-main">
        <form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.model_name }}_form" novalidate>
            {% csrf_token %}
            {% block form_top %}{% endblock %}
            {% if errors %}
                <p class="errornote">
                    {% if errors|length == 1 %}
                        {% translate "Please correct the error below." %}
                    {% else %}
                        {% translate "Please correct the errors below." %}
                    {% endif %}
                </p>
                {{ adminform.form.non_field_errors }}
            {% endif %}
            {% for fieldset in adminform %}
                {% include "admin/includes/fieldset.html" %}
            {% endfor %}
            {% block after_field_sets %}{% endblock %}
            {% for inline_admin_formset in inline_admin_formsets %}
                {% include inline_admin_formset.opts.template %}
            {% endfor %}
            {% block after_related_objects %}{% endblock %}
            {% block submit_buttons_bottom %}{% submit_row %}{% endblock %}
            {% block prepopulated_fields_js %}
                {{ block.super }}
            {% endblock %}
            {% block extra_js %}{% endblock %}
        </form>
    </div>
{% endblock %}

{% block extrahead %}
    {{ block.super }}
    <style>
        .field-url {
            width: 100%;
        }
        .field-url input {
            width: 100%;
        }
        .help {
            color: #666;
            font-size: 12px;
            margin-top: 5px;
            display: block;
        }
    </style>
{% endblock %}
